/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 magic_mirror.h

	$Header: /heroes4/magic_mirror.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( MAGIC_MIRROR_H_INCLUDED )
#define MAGIC_MIRROR_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>
#include "combat_creature_ptr.h"
#include "combat_spell_ptr.h"
#include "handler.h"

enum  t_spell;
class t_window;
// -----------------------------------------------------------------
// mirror a spell after all animation finishes
// -----------------------------------------------------------------
class t_mirror_spell_action : public t_handler_base
{
public:
	t_mirror_spell_action( t_combat_creature_ptr creature, t_combat_spell* spell, 
		                   int power );

	virtual void operator()();
protected:
	t_combat_creature_ptr m_creature;
	int					  m_power;
	t_combat_spell_ptr    m_spell;
};

// -----------------------------------------------------------------
// mirror a spell after all animation finishes
// -----------------------------------------------------------------
class t_mirror_spell_handler : public t_handler_base_1<t_window*>
{
public:
	t_mirror_spell_handler( t_combat_creature_ptr creature,  t_combat_spell* spell,
		                    int power );

	virtual void operator()( t_window* window );
protected:
	t_combat_creature_ptr m_creature;
	int					  m_power;
	t_combat_spell_ptr    m_spell;
};

void cast_and_mirror( t_combat_creature* attacker, t_combat_creature* defender,
					  t_spell spell, std::string text = "" );


#endif // MAGIC_MIRROR_H_INCLUDED